<script setup>
import {ref} from 'vue'
import SiderMenu from "@/components/layout/sider-menu.vue";
import Header from '@/components/layout/header.vue'
import Crumb from "@/components/layout/crumb.vue";

const collapsed = ref(false)

const changeSiderFold = (subValue) => {
  collapsed.value = subValue
}

</script>

<template>
  <div class="main">
    <a-layout>
      <a-layout-sider v-model:collapsed="collapsed" :trigger="null" collapsible>
          <SiderMenu />
      </a-layout-sider>
      <a-layout>
        <a-layout-header style="background: #fff; padding: 0">
          <Header @parentChangeFold="changeSiderFold"/>
        </a-layout-header>
        <Crumb />
        <a-layout-content
            :style="{ margin: '24px 16px', background: '#F0F2F5', minHeight: '280px' }"
        >
          <router-view />
        </a-layout-content>
      </a-layout>
    </a-layout>
  </div>
</template>

<style scoped lang="less">
.main {
  height: 100%;
  .ant-layout{
    height: 100%;
  }
}

#components-layout-demo-custom-trigger .trigger {
  font-size: 18px;
  line-height: 64px;
  padding: 0 24px;
  cursor: pointer;
  transition: color 0.3s;
}

#components-layout-demo-custom-trigger .trigger:hover {
  color: #1890ff;
}

#components-layout-demo-custom-trigger .logo {
  height: 32px;
  background: rgba(255, 255, 255, 0.3);
  margin: 16px;
}

.site-layout .site-layout-background {
  background: #fff;
}
</style>